<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>

//4.当参数跟局部变量重名的时候，优先级是等同

/*var a = 10;

function aaa(a){
	
	alert(a);   //10
	var a = 20;
	
}

aaa(a);*/

/*var a = 5;
var b = a;
b += 3;
alert(a);*/

/*var a = [1,2,3];
var b = a;
b.push(4);
alert(a);*/

/*var a = [1,2,3];
var b = a;
b = [1,2,3,4];
alert(a);*/

/*var a = 10;

function aaa(a){
	
	a += 3; 

}

aaa(a);

alert(a);*/

/*var a = [1,2,3];

function aaa(a){
	
	a.push(4); 

}

aaa(a);

alert(a);*/

var a = [1,2,3];

function aaa(a){
	
	return a = [1,2,3,4];

}

alert(aaa(a));

alert(a);


</script>
</head>

<body>
</body>
</html>
